/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.fii.DAO;
import com.fii.entity.PgPlanestudio;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;




/**
 *
 * @author Giancarlo
 */
public class PgPlanEstudioDAO {
 
    private EntityManagerFactory emf;
    private EntityManager em;

    public PgPlanEstudioDAO() {
        emf=Persistence.createEntityManagerFactory("PA-FIIPU");
        em=emf.createEntityManager();
    }
     public void closeEntityManager(){
        em.close();
    }
     public boolean insertarPlanEstudio(PgPlanestudio pe){
         boolean b=false;
        try{
            em.getTransaction().begin();
            em.persist(pe);
            em.getTransaction().commit();
            b=true;
        }
        catch(Exception ex){
            em.getTransaction().rollback();
           
        }
        return b;
     }
             
    
    
}
